package cn.cvzhanshi.wechatpush.utils;

import cn.cvzhanshi.wechatpush.constant.WeChatConstant;
import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;

/**
 * TODO
 *
 * @author yupeng
 * @version 1.0
 * @date 2022/8/22 18:41
 */
public class WeChatUtils {

    public static WxMpService getWxMpService() {
        //1，配置
        WxMpInMemoryConfigStorage wxStorage = new WxMpInMemoryConfigStorage();
        wxStorage.setAppId(WeChatConstant.appId);
        wxStorage.setSecret(WeChatConstant.secret);
        WxMpService wxMpService = new WxMpServiceImpl();
        wxMpService.setWxMpConfigStorage(wxStorage);
        return wxMpService;
    }
}
